package com.suray.attendance;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Description: 计划排产的主启动类
 * Author: linyu
 * Date: 2023/11/11
 */
@EnableCaching  //开启缓存
@SpringBootApplication
@EnableScheduling  // 开启定时任务
@EnableSwagger2
@MapperScan({"com.suray.attendance.db.mapper"})
@ComponentScan({"com.suray"})
@EnableAsync
public class AttendanceReportApplication extends SpringBootServletInitializer {
    private final static Logger logger = LoggerFactory.getLogger(AttendanceReportApplication.class);

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(AttendanceReportApplication.class);
    }
    public static void main(String[] args) {
        SpringApplication.run(AttendanceReportApplication.class, args);
        logger.info(AttendanceReportApplication.class.getSimpleName() + " is success!");
    }
}